home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 2002 January / PC Answers January 2002.7z / PC Answers January 2002.bin / graphics / freepixl / _SETUP.1 / HTMLdlg.pxl < prev    next >
Text File  |  2000-12-23  |  5KB  |  180 lines

  1. {    Filename    :     a.pxl
  2.      Purpose    :    <purpose>
  3.     Date        :    January 5, 2000
  4.     Author        :    <author name (optional: company)>
  5. History:
  6.  
  7.     Version    :  4.40    RELEASE
  8.     Update        :  
  9.     Date        :  
  10.  
  11. --------------------------------------------------------------------------}
  12. Initialize: {only one instance allowed}
  13.     UseCoordinates(PIXEL)
  14.     Title$ = "PiXCL Application Title"                                  
  15.     WinExist(Title$,Res)
  16.     If Res = 0 Then Goto One_Instance
  17.     Beep
  18.     WinSetActive(Title$,Res)
  19.     WinShow(Title$,RESTORE,Res)
  20.     End
  21. One_Instance:
  22.     UseCaption(Title$) {change the title}
  23.     WinLocate(Title$,534,171,1128,544,Res)                
  24.     UseBackground(TRANSPARENT,0,128,192)     
  25.     WinShow(Title$,NOTOPMOST,Res) 
  26.     DrawBackGround
  27.     DirGet(SourceDir$) {used later for library function calls}
  28.  
  29.     DragAcceptFile(ENABLE,AcceptFile)
  30.     AutoProgressBar(DISABLE)
  31.  
  32.     InfoMenu(REMOVE)
  33.     WaitInput(100)
  34.     SetMenu("&File",IGNORE,
  35.         "&New",CreatingFile,
  36.         "&Open",OpeningFile,
  37.         "&Save",SavingFile,
  38.         SEPARATOR,
  39.         "E&xit!",Terminate,
  40.         ENDPOPUP,
  41.         "&View",IGNORE,
  42.         "&ToolBar",ViewToolBar,
  43.         "&StatusBar",ViewStatusBar,
  44.         ENDPOPUP,
  45.         "&Information",IGNORE,
  46.         "&Concept",Concept,
  47.         "&Help",ShowAppHelp,
  48.         SEPARATOR,
  49.         "&About",About,
  50.         ENDPOPUP)
  51.  
  52.     GoSub MakeToolbar
  53.     ChangeMenuItem("&ToolBar",CHECK,TBRes)
  54.  
  55.         
  56.     StatusWindow(ENABLE,BOTTOM,2,200,-1,0,0)
  57.     DrawStatusWinText(0,"Ready")
  58.     ChangeMenuItem("&StatusBar",CHECK,SBRes)
  59.  
  60.     
  61. Wait_for_Input:
  62.     WaitInput()
  63.  
  64. Terminate:
  65.     End
  66.  
  67.  
  68. Concept:
  69.     MessageBox(OK,1,INFORMATION,
  70. "This is a skeleton of a PiXCL application.  You could briefly
  71. describe your application's function here, or provide some
  72. basic help information.",
  73.     "PiXCL Skeleton Concept",Res)
  74.  
  75.     Goto Wait_for_Input
  76.  
  77. ShowAppHelp:
  78.     {An application Help file usually has the same name as the application.}
  79.     Winhelp("a.hlp",CONTENTS,"")
  80.  
  81.     Goto Wait_for_Input
  82.  
  83. About:
  84.     AboutUser("PiXCL Application Title",  { or substitute Title$}
  85.       "Two lines of text goes here e.g. Application function.",
  86.     "Four Lines of additional information goes here, perhaps contact information and Web addresses")   
  87.  
  88.     Goto Wait_for_Input
  89.  
  90. ViewToolBar:
  91.     GetMenuStatus("&ToolBar",CHECKED,Res)
  92.     If Res = 0
  93.         GoSub MakeToolbar
  94.         ChangeMenuItem("&ToolBar",CHECK,Res)
  95.     Else
  96.         Toolbar()
  97.         ChangeMenuItem("&ToolBar",UNCHECK,Res)
  98.     Endif
  99.     Goto Wait_for_Input
  100.  
  101. ViewStatusBar:
  102.     GetMenuStatus("&StatusBar",CHECKED, Res)
  103.     If Res = 0
  104.         StatusWindow(ENABLE,BOTTOM,2,200,-1,0,0)
  105.         DrawStatusWinText(0,"Ready")
  106.         ChangeMenuItem("&StatusBar",CHECK,Res)
  107.     Else
  108.         StatusWindow(DISABLE,BOTTOM,2,200,-1,0,0)
  109.        ChangeMenuItem("&StatusBar",UNCHECK,Res)
  110.     Endif
  111.     Goto Wait_for_Input
  112.  
  113. CreatingFile:
  114.     WaitInput(1)
  115.     DrawBackground
  116.     HTMLFileName$ = SourceDir$ + "\sample.htm"
  117.     HTMLcontrol(HTMLFileName$, 
  118.         "Argument 1;Argument 2;Argument 3;Argument 4;Argument 5;Argument 6",Res$, Res) 
  119.     DrawText(20,60,Res$)
  120.     DrawNumber(20,80,Res)
  121.     FreeVar(Res$)
  122.     Goto Wait_for_Input
  123.  
  124. OpeningFile:
  125.     WaitInput(1)
  126.     {TODO: add file handling here}
  127.     MessageBox(OK,1,INFORMATION,"No operations coded for this button.",
  128.                     "Opening File",Res)
  129.     Goto Wait_for_Input
  130.  
  131. SavingFile:
  132.     WaitInput(1)
  133.     {TODO: add file handling here}
  134.     MessageBox(OK,1,INFORMATION,"No operations coded for this button.",
  135.                     "Saving File",Res)
  136.     Goto Wait_for_Input
  137.  
  138. PrintingFile:
  139.     WaitInput(1)
  140.     {TODO: add file handling here}
  141.     MessageBox(OK,1,INFORMATION,"No operations coded for this button.",
  142.                     "Printing File",Res)
  143.     Goto Wait_for_Input
  144.  
  145.  
  146. WorkingDirectory:
  147.     WaitInput(1)
  148.     RDBOpenKey(@RDB_CURRENT_USER, "Software\VYSOR Integration Inc\PiXCL MDI Editor\Settings",RegistryKey)
  149.     
  150.     SetWorkingDirBox("", "", RegistryKey, Selection$, Res)
  151.  
  152.     DebugMsgBox(Selection$)
  153.  
  154.     RDBCloseKey(RegistryKey,Res)
  155.     Goto Wait_for_Input
  156.  
  157. AcceptFile:
  158.     GetDragList(FileList$)
  159.     {TODO: add file list handling here, or delete this whole label handler}
  160.     Goto Wait_for_Input
  161.     
  162. {--- Style Suggestion: place all subroutines at the end of the script.}
  163.  
  164. MakeToolbar: {subroutine}
  165.     Toolbar(FLAT, PXL_LARGE,
  166.         NULL, NULL, SEPARATOR, "", Wait_for_Input, 
  167.         PXL_NEW, ENABLED, STD, "Show HTML control", CreatingFile,
  168.         PXL_OPEN, ENABLED, STD, "FileOpen", OpeningFile, 
  169.         PXL_SAVE, ENABLED, STD, "FileSave", SavingFile, 
  170.         PXL_PRINT,  ENABLED, STD,"PrintFile", PrintingFile, 
  171.         NULL, NULL, SEPARATOR, "", Wait_for_Input, 
  172.         DIALOG, ENABLED, STD,"Set the Working Directory", WorkingDirectory,
  173.         NULL, NULL, SEPARATOR, "", Wait_for_Input, 
  174.         HELPINFO, ENABLED, STD,"Show Help",ShowAppHelp,
  175.         NULL, NULL, SEPARATOR, "", Wait_for_Input) 
  176.  
  177.     Return
  178.  
  179.  
  180.